<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');  
    class dataload {
        private $CI;
        private $page;
        private $master_init;

        function dataload(){
            $this->CI = & get_instance();
        } 

        function getdata($cur_page,$master){

            $this->page = $cur_page;
            $this->master_init = $master;

            switch($this->page){
                case "onama":            $this->onama();             break;
                case "ocrnojgori":       $this->ocrnojgori();        break;
                case "reference":        $this->reference();         break;
                case "tours":            $this->tours();             break;
                case "adventurestours":  $this->adventurestours();   break;  
                case "news":             $this->news();              break; 
                case "admin":            $this->admin();             break; 
            }

        }
        
        function onama(){
            $res = $this->CI->db->get_where('text', array('page_id'=>2))->result_array();
            $this->master_init->data['text'] = $res;
        }
            function ocrnojgori(){
            $res = $this->CI->db->get_where('text', array('page_id'=>1))->result_array();
            $this->master_init->data['text'] = $res;
        }
        
        function reference(){
            $res = $this->CI->db->get_where('text', array('page_id'=>3))->result_array();
            $this->master_init->data['text'] = $res;
        }
    }